//
//  HNSH_GoodsDetailShopCell.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/2/25.
//

#import "HNSH_GoodsDetailShopCell.h"

@interface HNSH_GoodsDetailShopCell ()
/* lineView */
@property (nonatomic, strong) UIView *lineView;
/* titleLabel */
@property (nonatomic, strong) UILabel *titleLabel;
/* showLabel */
@property (nonatomic, strong) UILabel *showLabel;
/* showImgV */
@property (nonatomic, strong) UIImageView *showImgV;

@end

@implementation HNSH_GoodsDetailShopCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = [UIColor appWhiteLabelColor];
        [self configUI];
    }
    return self;
}

- (void)setShopName:(NSString *)shopName {
    _shopName = shopName;
    self.titleLabel.text = [NSString stringWithFormat:@"店铺名称：%@",shopName];
}

- (void)configUI {
    [self.contentView addSubview:self.lineView];
    [self.contentView addSubview:self.titleLabel];
    [self.contentView addSubview:self.showLabel];
    [self.contentView addSubview:self.showImgV];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(16);
        make.centerY.equalTo(self.mas_centerY);
        make.height.mas_equalTo(30);
    }];
    
    [self.showLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-36);
        make.centerY.equalTo(self.mas_centerY);
        make.height.mas_equalTo(28);
    }];
    
    [self.showImgV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-16);
        make.centerY.equalTo(self.mas_centerY);
        make.width.mas_equalTo(16);
        make.height.mas_equalTo(16);
    }];
}

#pragma mark lazy
- (UIView *)lineView {
    if (!_lineView) {
        _lineView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, 1)];
        _lineView.backgroundColor = [UIColor colorWithHexString:@"#EDEDED"];
    }
    return _lineView;
}

- (UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [UILabel new];
        _titleLabel.text = @"店铺名称：";
        _titleLabel.textColor = [UIColor appBlackLabelColor];
        _titleLabel.font = [UIFont systemFontOfSize:14];
    }
    return _titleLabel;
}

- (UILabel *)showLabel{
    if (!_showLabel) {
        _showLabel = [UILabel new];
        _showLabel.text = @"进店查看";
        _showLabel.textColor = [UIColor appGrayLabelColor];
        _showLabel.font = [UIFont systemFontOfSize:14];
        _showLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _showLabel;
}

- (UIImageView *)showImgV {
    if (!_showImgV) {
        _showImgV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"goods_detail_show"]];
    }
    return _showImgV;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
